from selenium import webdriver
from selenium.webdriver.edge.service import Service
from selenium.webdriver.common.by import By
import time
# driver_path = r"D:\Gao5\pythonProject\2302A_test\msedgedriver.exe"  # 替换为实际路径
# service = Service(driver_path)
# driver = webdriver.Edge(service=service)



# 连接浏览器
driver=webdriver.Edge()
# 窗口最大化
driver.maximize_window()
# 找到页面地址
driver.get('http://10.59.9.12:7001/')
time.sleep(3)
driver.find_element(By.XPATH,'/html/body/div[1]/div/div[2]/ul/li[1]/a').click()
time.sleep(3)
dy1=driver.find_element(By.CLASS_NAME,'reg-new').text
print(dy1)
# 页面跳转
driver.switch_to.window(driver.window_handles[-1])

driver.find_element(By.NAME,'username').send_keys('13811033962')
time.sleep(3)
driver.find_element(By.NAME,'password').send_keys('123456')
time.sleep(10)
driver.find_element(By.XPATH,'//*[@id="theForm"]/div[5]/a').click()
time.sleep(6)
dy2=driver.find_element(By.XPATH,'/html/body/div[1]/div/div[2]/ul/li[1]/a').text
print(dy2)
